package com.biz.jobs.base;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.biz.service.HService.schedule.TestServiceI;
import com.biz.service.HService.schedule.base.SchedulerServiceI;
import com.biz.utils.SpringApplicationContextHolder;

public class ScanAllQuartzJob implements Job {
	 private static Logger log = LoggerFactory.getLogger(ScanAllQuartzJob.class);
	 
//	 @Autowired
//	private TestServiceI schedulerService;
		
	 public void execute(JobExecutionContext context)throws JobExecutionException{
	        log.info("ScanAllQuartzJob任务启动...");
	        try {
	        	SchedulerServiceI schedulerService = (SchedulerServiceI)SpringApplicationContextHolder.getBean("schedulerService");	        	
	        	System.out.println("=================开始了===============");
	        	schedulerService.searchAllJob();
			} catch (Exception e) {
				e.printStackTrace();
				log.info("ScanAllQuartzJob任务启动失败...");
			}
	       
	        log.info("ScanAllQuartzJob任务结束...");
	         
	    }

}
